
FROM harbor.eniot.io/envisioniot/nginx:latest

ENV APP_NAME solar-health-degree-frontend
ENV NGINX_HOME /var/www
ENV APP_DIR $NGINX_HOME/$APP_NAME

COPY ./build $APP_DIR/

COPY nginx.conf /etc/nginx/nginx.conf
RUN chown -R 1088:1088 /etc/nginx /var/www /var/cache /var/run
RUN groupadd -g 1088 envuser && useradd -u 1088 -r -g envuser -s /sbin/nologin -c "Default Application User" envuser

EXPOSE 8080
USER 1088
ENTRYPOINT ["nginx","-g","daemon off;"]